package com.example.li893.drag;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;


    public class SquareFrameLayout extends FrameLayout {
        public SquareFrameLayout(Context context) {
            super(context);
        }

        public SquareFrameLayout(Context context, AttributeSet attrs) {
            super(context, attrs);
        }

        public SquareFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
            super(context, attrs, defStyleAttr);
        }

        @Override
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            super.onMeasure(heightMeasureSpec, heightMeasureSpec);    //把宽度测量空间传给高度测量空间
        }
    }

